function panTarget(dom, target, container, callback) {
				this.dom = dom;
				this.target = target;
				this.container = container;
				this.pos_x = $(dom).offset().left;
				this.pos_y = $(dom).offset().top;
				this.pos_Width = $(dom).width();
				this.pos_Height = $(dom).height();
				this.targetLeft = $(target).offset().left;
				this.targetTop = $(target).offset().top;
				this.targetWidth = $(target).width();
				this.targetHeight = $(target).height();
				this.containerWidth = $(container).width();
				this.containerHeight = $(container).height();
				this.containerLeft = $(container).offset().left;
				this.containerTop = $(container).offset().top;
				if(typeof callback !== "function") {
					throw "请传入函数"
				} else {
					this.callback = callback;
				}
			}
			panTarget.prototype.judge = function() {
				if(this.pos_x>=this.targetLeft && this.pos_x<=this.targetLeft+this.targetWidth && this.pos_y>=this.targetTop && this.pos_y<=this.targetHeight+this.targetTop){
					this.callback(true);
				}else{
					this.callback(false);
					console.log(this);
				}
			}
			
			panTarget.prototype.panjudge = function(x,y){
				if(x<0){
					x=0;
				}
				if(y<0){
					y=0;
				}
				if(x>this.containerWidth-this.pos_Width){
					x=this.containerWidth-this.pos_Width;
				} 
				if(y>this.containerHeight-this.pos_Height){
					y=this.containerHeight-this.pos_Height;
				} 
				$(this.dom).css({
					"left": x,
					"top": y
				});
			}
			panTarget.prototype.init = function() {
				var _ = this;
				var hammer = new Hammer($(this.dom).get(0));
				hammer.get('pan').set({
					direction: Hammer.DIRECTION_ALL
				});
				hammer.on("pan", function(e) {
					_.panjudge(_.pos_x+e.deltaX,_.pos_y + e.deltaY);
				});
				hammer.on("panend", function() {
					_.pos_x = $(_.dom).position().left;
					_.pos_y = $(_.dom).position().top;
					_.judge();
				});
			}
